import request from '@/utils/request'

// 查询订单列表
export function listOrder(query, headers) {
  console.log(query)
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: `/mall/order/list`,
    method: 'post',
    data: query
  })
}

export function exportOrder(query, headers) {
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: '/mall/order/export',
    method: 'get',
    params: query
  })
}

export function updateOrder(data, headers) {
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: `/mall/order`,
    method: 'post',
    data: data
  })
}

export function updateDelivery(data, headers) {
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: '/mall/delivery',
    method: 'post',
    data: data
  })
}

export function subscribe(data, headers) {
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: '/mall/delivery/subscribe',
    method: 'post',
    data: data
  })
}

export function notifyRefund(data, headers) {
  return request({
    headers: Object.assign({}, request.headers, headers),
    url: '/mini/template/uniformSend',
    method: 'post',
    data: data
  })
}
